package com.mzj.saas.mservice.lifePay.repository;

import com.mzj.saas.mservice.lifePay.entity.HousePaymentBind;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface HousePaymentBindRepository extends PagingAndSortingRepository<HousePaymentBind, Long>, JpaSpecificationExecutor<HousePaymentBind>, JpaRepository<HousePaymentBind, Long> {
    List<HousePaymentBind> findByUserId(String userId);

    @Transactional
    void deleteByLivingPaymentGroupId(Long livingPaymentGroupId);

    List<HousePaymentBind> findByUserIdAndHouseIdAndStatus(String userId, String houseId, Integer status);
}
